package com.example.demo.dao;

import com.example.demo.entity.ClassroomEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ClassroomDao {

    /**
     * 通过ID查询单条数据
     */
    public ClassroomEntity queryClassroomById(Integer cid);


    /**
     * 通过实体作为筛选条件查询
     */
    public List<ClassroomEntity> queryClassroomAll();

    /**
     * 新增数据
     */
    public int insertClassroom(ClassroomEntity classroom);

    /**
     * 修改数据
     */
    public int updateClassroom(ClassroomEntity classroom);

    /**
     * 通过主键删除数据
     */
    public int deleteClassroomById(Integer cid);

    /**
     * 教室判重名
     */
    public ClassroomEntity checkByCname(String cname);

    //根据选择的教室类型查询有此楼下有多少教室
    public List<ClassroomEntity> selectClassByClassType(Integer ctid);

    //通过bid borname查教室
    public List<ClassroomEntity> queryClassroomByEntity(ClassroomEntity classroomEntity);

    //通过borname查教室
    public ClassroomEntity queryClassroomByBorname(String borname);

    //通过bid查教室
    public List<ClassroomEntity> queryClassroomByBid(ClassroomEntity classroomEntity);

    //通过楼层查教室
    public List<ClassroomEntity> seleByFid(@Param("fid") int fid, @Param("bid") int bid);
}